In [3]:
# librerias
import numpy as np
In [4]:
my_list = [1,2,3]
my_list
Out[4]:
In [5]:
np.array(my_list)
Out[5]:
In [6]:
my_matrix = [[1,2,3],[4,5,6],[7,8,9]]
my_matrix
Out[6]:
In [7]:
np.arange(0,10)
Out[7]:
In [8]:
np.arange(0,11,2)
Out[8]:
In [9]:
np.zeros(3)
Out[9]:
In [10]:
np.zeros((5,5))
Out[10]:
In [11]:
np.ones(3)
Out[11]:
In [12]:
np.ones((3,3))
Out[12]:
In [13]:
np.linspace(0,10,3)
Out[13]:
In [14]:
np.linspace(0,10,50)
Out[14]:
In [15]:
np.eye(4)
Out[15]:
In [16]:
np.random.rand(2)
Out[16]:
In [17]:
np.random.rand(5,5)
Out[17]:
In [18]:
np.random.randn(2)
Out[18]:
In [19]:
np.random.randn(5,5)
Out[19]:
In [20]:
np.random.randint(1,100)
Out[20]:
In [21]:
np.random.randint(1,100,10)
Out[21]:
In [22]:
arr = np.arange(25)
ranarr = np.random.randint(0,50,10)
In [23]:
arr
Out[23]:
In [24]:
ranarr
Out[24]:
In [25]:
arr.reshape(5,5)
Out[25]:
In [26]:
ranarr
Out[26]:
In [27]:
ranarr.max()
Out[27]:
In [28]:
ranarr.argmax()
Out[28]:
In [29]:
ranarr.min()
Out[29]:
In [30]:
ranarr.argmin()
Out[30]:
In [31]:
# Vector
arr.shape
Out[31]:
In [32]:
# Tomar en cuenta que se implementan dos corchetes
arr.reshape(1,25)
Out[32]:
In [33]:
arr.reshape(1,25).shape
Out[33]:
In [34]:
arr.reshape(25,1)
Out[34]:
In [35]:
arr.reshape(25,1).shape
Out[35]:
In [38]:
arr.dtype
Out[38]:
In [ ]: